home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / kbd.preinst < prev    next >
Text File  |  2009-06-24  |  875b  |  38 lines

  1. #! /bin/sh -e
  2.  
  3. # Prepare to remove a no-longer used conffile
  4. prep_rm_conffile()
  5. {
  6.     PKGNAME="$1"
  7.     CONFFILE="$2"
  8.     ACTION="$3"
  9.  
  10.     if [ -e "$CONFFILE" ]; then
  11.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  12.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
  13.         if [ "$md5sum" != "$old_md5sum" ]; then
  14.             if [ "$ACTION" = rename ]; then
  15.                 echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak"
  16.                 mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  17.             fi
  18.         else
  19.             if [ "$ACTION" = remove ]; then
  20.                 echo "Removing obsolete conffile $CONFFILE"
  21.                 mv -f "$CONFFILE" "$CONFFILE".moved-by-preinst
  22.             fi
  23.         fi
  24.     fi
  25. }
  26.  
  27. case $1 in
  28.     install|upgrade)
  29.         if dpkg --compare-versions "$2" lt 1.14.1-4ubuntu3; then
  30.             prep_rm_conffile kbd /etc/init.d/console-screen.kbd.sh remove
  31.         fi
  32.         ;;
  33. esac
  34.  
  35.  
  36.  
  37. exit 0
  38.